package com.yoso.base.infrastructure.factory;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ReflectUtil;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.BeanUtils;

/**
 * @author shizejin
 * @date 2022/1/30
 * @description:
 */
public class BeanFactory {
    public static <T> T convertBean(Object source,Class<T> target){
        T instance = ReflectUtil.newInstance(target);
        BeanUtils.copyProperties(source, instance);
        return instance;
    }
}
